Edit Attribute via Object Properties Dialog

Hello,

I'm trying to write a script to open the "Object Properties" dialog box, go to the attributes tab, select a specific attribute and "View/Edit". Editing with that window seems more convenient, especially when working with a lot of data. The hotkey to the Object Properties window is Ctrl+e, if that helps. I want to get to the point to where I can have the View/Edit window pop up and sized to a determined value.

Upon looking into this, I tried just including the showProperties.dxl file, but I can only run it once. If I try to run it again, DOORS crashes.

Does anyone have a clever way of doing this already, or maybe we can step through it? I appreciate any help!
DaveBoy368 - Thu Feb 16 15:16:20 EST 2012

Re: Edit Attribute via Object Properties Dialog
Mathias Mamsch - Fri Feb 17 09:03:41 EST 2012

I think you need to launch those dialogs on top level otherwise it will not work. Try wrapping your script in a top level context:
 

evalTop_ "#include <myfile.dxl>"

 


where myfile.dxl is the file that will open the dialog. Maybe that helps, regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: Edit Attribute via Object Properties Dialog
DaveBoy368 - Mon Feb 20 07:46:02 EST 2012

Mathias Mamsch - Fri Feb 17 09:03:41 EST 2012

I think you need to launch those dialogs on top level otherwise it will not work. Try wrapping your script in a top level context:
 

evalTop_ "#include <myfile.dxl>"

 


where myfile.dxl is the file that will open the dialog. Maybe that helps, regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Perfect! That seems to work just fine. Thank you!

Now, to my next part; switching to the attributes tab. I've tried using a function like:
 

SetupMainDialog(ATTRIBUTES_TAB)


or

 

SetupMainDialogForObject(ATTRIBUTES_TAB)


or

 

 

SetupMainDialogForObjectProperties(ATTRIBUTES_TAB)



...but to no avail. Any idea what the function is to call this tab?



 

Re: Edit Attribute via Object Properties Dialog
Mathias Mamsch - Mon Feb 20 08:21:09 EST 2012

DaveBoy368 - Mon Feb 20 07:46:02 EST 2012

Perfect! That seems to work just fine. Thank you!

Now, to my next part; switching to the attributes tab. I've tried using a function like:
 

SetupMainDialog(ATTRIBUTES_TAB)


or

 

SetupMainDialogForObject(ATTRIBUTES_TAB)


or

 

 

SetupMainDialogForObjectProperties(ATTRIBUTES_TAB)



...but to no avail. Any idea what the function is to call this tab?



 

You could maybe try something like:
 

evalTop_ ("
showSelectedTab(objectPropertiesTabSkip, OBJPROPS_ATTRIBUTES_TAB)
set(theTab, OBJPROPS_ATTRIBUTES_TAB)
")

 


What DOORS Version are you using? Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: Edit Attribute via Object Properties Dialog
DaveBoy368 - Mon Feb 20 14:27:23 EST 2012

Mathias Mamsch - Mon Feb 20 08:21:09 EST 2012

You could maybe try something like:
 

evalTop_ ("
showSelectedTab(objectPropertiesTabSkip, OBJPROPS_ATTRIBUTES_TAB)
set(theTab, OBJPROPS_ATTRIBUTES_TAB)
")

 


What DOORS Version are you using? Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

9.3

Re: Edit Attribute via Object Properties Dialog
DaveBoy368 - Mon Feb 20 14:41:57 EST 2012

DaveBoy368 - Mon Feb 20 14:27:23 EST 2012
9.3

I'm getting the following error:

-R-E- DXL: <standard/object/properties.dxl:458> null Module parameter was passed into argument position 1
Backtrace:
<standard/object/properties.dxl:596>
<standard/object/showProperties.dxl:15>
<standard/object/properties.dxl:596>
<standard/object/showProperties.dxl:15>
<standard/object/properties.dxl:596>
<standard/object/showProperties.dxl:15>
<standard/object/properties.dxl:596>
<standard/object/showProperties.dxl:15>
<standard/object/properties.dxl:596>
<standard/object/showProperties.dxl:15>
-I- DXL: execution halted

I've cleared the code that I was playing with and only am trying to include the showProperties.dxl and it shows this error. Even after restart. Not sure what the argument is that I'm passing "null" through.

Re: Edit Attribute via Object Properties Dialog
Mathias Mamsch - Mon Feb 20 16:38:53 EST 2012

DaveBoy368 - Mon Feb 20 14:41:57 EST 2012
I'm getting the following error:

-R-E- DXL: <standard/object/properties.dxl:458> null Module parameter was passed into argument position 1
Backtrace:
<standard/object/properties.dxl:596>
<standard/object/showProperties.dxl:15>
<standard/object/properties.dxl:596>
<standard/object/showProperties.dxl:15>
<standard/object/properties.dxl:596>
<standard/object/showProperties.dxl:15>
<standard/object/properties.dxl:596>
<standard/object/showProperties.dxl:15>
<standard/object/properties.dxl:596>
<standard/object/showProperties.dxl:15>
-I- DXL: execution halted

I've cleared the code that I was playing with and only am trying to include the showProperties.dxl and it shows this error. Even after restart. Not sure what the argument is that I'm passing "null" through.

The above code works only if the object properties is already open. I tested the code only in DOORS 8 but it seems to be running under DOORS 9 without any DXL errors. You need to include those two code lines after your code where you opened the object properties dialog in your include file. You still need to launch the include file with evalTop_. Notice that you might need to have the current Module set before launching the code. Maybe that helps, Regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Edit Attribute via Object Properties Dialog
DaveBoy368 - Tue Feb 21 07:45:07 EST 2012

Mathias Mamsch - Mon Feb 20 16:38:53 EST 2012
The above code works only if the object properties is already open. I tested the code only in DOORS 8 but it seems to be running under DOORS 9 without any DXL errors. You need to include those two code lines after your code where you opened the object properties dialog in your include file. You still need to launch the include file with evalTop_. Notice that you might need to have the current Module set before launching the code. Maybe that helps, Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

I realized that it needed to be separate, although I already set some parameter that is returning "null" into the argument. In other words, I'm trying to start over and only use the code:
 

evalTop_ "#include <standard/object/showProperties.dxl>"

 


...which is where I get the error:

-R-E- DXL: <standard/object/properties.dxl:458> null Module parameter was passed into argument position 1
Backtrace:
<standard/object/properties.dxl:596>
<standard/object/showProperties.dxl:15>

I put the code in incorrectly the first time, and it has shown me this error ever since. I believe I originally ran this code to get the error:

 

 

 

evalTop_ "
#include <standard/object/showProperties.dxl>
showSelectedTab(objectPropertiesTabSkip, OBJPROPS_ATTRIBUTES_TAB)
set(theTab, OBJPROPS_ATTRIBUTES_TAB)
"



I must need to clear a variable or something. It keeps giving me this error even after restart, so I'm stuck at this point until I can clear the error. Thank you for your help Mathias, I appreciate it!



 

 

Re: Edit Attribute via Object Properties Dialog
Mathias Mamsch - Wed Feb 22 11:28:03 EST 2012

DaveBoy368 - Tue Feb 21 07:45:07 EST 2012

I realized that it needed to be separate, although I already set some parameter that is returning "null" into the argument. In other words, I'm trying to start over and only use the code:
 

evalTop_ "#include <standard/object/showProperties.dxl>"

 


...which is where I get the error:

-R-E- DXL: <standard/object/properties.dxl:458> null Module parameter was passed into argument position 1
Backtrace:
<standard/object/properties.dxl:596>
<standard/object/showProperties.dxl:15>

I put the code in incorrectly the first time, and it has shown me this error ever since. I believe I originally ran this code to get the error:

 

 

 

evalTop_ "
#include <standard/object/showProperties.dxl>
showSelectedTab(objectPropertiesTabSkip, OBJPROPS_ATTRIBUTES_TAB)
set(theTab, OBJPROPS_ATTRIBUTES_TAB)
"



I must need to clear a variable or something. It keeps giving me this error even after restart, so I'm stuck at this point until I can clear the error. Thank you for your help Mathias, I appreciate it!



 

 

No under DOORS 8 the code works, but in DOORS 9 not any longer. For DOORS 9 you need to do the below. The code before the evalTop_ is a hopefully save way to marshal the current Module to the evalTop context. Hope that helps, regards, Mathias
 

Module mod = current 
 
string mvVer = "moduleVersion (module \"" (fullName mod) "\")" 
if (isBaseline mod) {
    Baseline b = baseline moduleVersion mod
    string sVer = (major b) ", " (minor b) ", \"" (suffix b) "\""
    mvVer = "moduleVersion (module \"" (fullName mod) "\", baseline(" sVer "))"
}
 
 
print mvVer
 
 
evalTop_ "
current = data " (mvVer) "
if (null current Module) halt
showObjectAttributes()
"

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Re: Edit Attribute via Object Properties Dialog
DaveBoy368 - Wed Feb 22 13:53:21 EST 2012

Mathias Mamsch - Wed Feb 22 11:28:03 EST 2012

No under DOORS 8 the code works, but in DOORS 9 not any longer. For DOORS 9 you need to do the below. The code before the evalTop_ is a hopefully save way to marshal the current Module to the evalTop context. Hope that helps, regards, Mathias
 

Module mod = current 
 
string mvVer = "moduleVersion (module \"" (fullName mod) "\")" 
if (isBaseline mod) {
    Baseline b = baseline moduleVersion mod
    string sVer = (major b) ", " (minor b) ", \"" (suffix b) "\""
    mvVer = "moduleVersion (module \"" (fullName mod) "\", baseline(" sVer "))"
}
 
 
print mvVer
 
 
evalTop_ "
current = data " (mvVer) "
if (null current Module) halt
showObjectAttributes()
"

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

This definitely helped. The code works to bring open the attributes tab of the object properties dialog box.

First off, I'm wondering if there is a simpler way to just directly call the "View/Edit" Attribute Value dialog box without having to march through it like I originally thought. If so, then I would just need to learn to resize the dialog box and I would have what I'm looking for.

Otherwise, I need to add code to select an attribute based on its name and then run the "View/Edit" function (whatever it may be) to open the appropriate dialog box. Then I'd still need resize the box, which may not be possible.

What do you think?